<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <p>表单修饰符</p>
    <p>1. lazy.延迟响应，事件由input变为change事件。防抖节流，用在搜索框上</p>
    <input type="text" v-model.lazy="val1">
    <p>{{val1}}</p>
    <p>2. number,只能输入数字。用在购物车上</p>
    <input type="text" v-model.number="val2">
    <p>{{val2}}</p>
    <p>3. trim，过滤首尾空格。用在用户名等场景</p>
    <input type="text" v-model.trim="val3">
    <p>{{val3}}</p>
  </div>
  <script src="../vue.js"></script>
  <script>
    let vm = new Vue({
      el: '#app',
      data: {
        val1: '',
        val2: '',
        val3: ''
      }
    })
  </script>
</body>
</html>